package gof_003_行为型_Behavioral.gof_005_责任链_ChainOfResponsibility.gof_004_Chain;

/**
 * 骑手
 */
public class Role_Rider implements Role_Takeout {
    private int status;

    public Role_Rider(int status) {
        this.status = status;
        switch (status) {
            case 5:
                delivery();
                break;
            default:
                break;
        }
    }

    /**
     * 送货
     */
    private void delivery() {
        System.out.println("骑手接单...");
        Utils.sleep(1);

        int scanner = Utils.scanner("请模拟骑手是否准确送达！[1]翻车\t[2]送达");

        if (scanner == 1) {
            System.out.println("骑手翻车了!!!");
            Utils.sleep(1);

            new Role_MeiTuan(7);
        } else if (scanner == 2) {
            System.out.println("骑手送达!!!");
            Utils.sleep(1);

            new Role_MeiTuan(9);
        }
    }
    /**################################ 分割线 ################################*/
}